<template>
  <div>
    <!-- 主题设置菜单 -->
    <el-drawer v-model="layout.rightDrawer" direction="rtl" size="30%" :show-close="false" :with-header="false">
      <h1 class="theme_title">系统主题配置</h1>
      <div class="divider"></div>
      <div class="theme_item">
        <h4>主题色</h4>
        <el-color-picker v-model="color" show-alpha :predefine="predefineColors" />
      </div>
      <div class="theme_item">
        <h4>关闭 Tabs</h4>
        <el-switch v-model="layout.tabsHidden" />
      </div>
      <div class="theme_item">
        <h4>固定 Header</h4>
        <el-switch />
      </div>
      <div class="theme_item">
        <h4>隐藏 Logo</h4>
        <el-switch v-model="layout.logoHidden" />
      </div>
      <div class="theme_item">
        <h4>当前浏览器</h4>
        <BrowserIcon />
      </div>
      <div class="theme_item">
        <h4>当前设备</h4>
        <EquipmentIcon />
      </div>
    </el-drawer>
  </div>
</template>

<script setup>
import { ref } from 'vue'
import EquipmentIcon from "@/components/equipmentIcon.vue";// 设备图标
import BrowserIcon from "@/components/browserIcon.vue";//浏览器图标

// 使用pinia
import useStore from "@/pinia/index.js";
const { layout } = useStore();
// 默认颜色
const color = ref('rgba(255, 69, 0, 0.68)')
// 定义预设颜色
const predefineColors = ref([
  '#ff4500',
  '#ff8c00',
  '#ffd700',
  '#90ee90',
  '#00ced1',
  '#1e90ff',
  '#c71585',
  'rgba(255, 69, 0, 0.68)',
  'rgb(255, 120, 0)',
  'hsv(51, 100, 98)',
  'hsva(120, 40, 94, 0.5)',
  'hsl(181, 100%, 37%)',
  'hsla(209, 100%, 56%, 0.73)',
  '#c7158577',
])

</script>

<style lang="less" scoped>
// 分割线
.divider {
  width: 100%;
  display: flex;
  clear: both;
  min-width: 100%;
  margin: 10px 0;
  box-sizing: border-box;
  padding: 0;
  color: rgba(0, 0, 0, .85);
  font-size: 14px;
  border-top: 1px solid rgba(0, 0, 0, .09);
  list-style: none;
  line-height: 1.5715;
}

.theme_title {
  font-size: 20px;
  font-weight: bold;
  color: rgba(0, 0, 0, .85);
  margin-bottom: 20px;
}

.theme_item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 0;
}
</style>